package com.itHsuSE.demo1;

public class BinaryTest {
    public static void main(String[] args) {
        //二进制
        int n1=0b1010;
        //十进制
        int n2=1010;
        //八进制
        int n3=01010;
        //十六进制
        int n4=0x10101;
        System.out.println("n1="+n1);
        System.out.println("n2="+n2);
        System.out.println("n3="+n3);
        System.out.println("n4="+n4);
        System.out.println("===========");
        int a=1>>2; // 1 向右位移 2 位
        int b=-1>>2;//算术右移
        int c=1<<2;//算术左移
        int d=-1<<2;//
        System.out.println("a="+a);
        System.out.println("b="+b);
        System.out.println("c="+c);
        System.out.println("d="+d);
    }
}
